

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class WidgetUtils{

  ///单个按钮弹窗
   static Future showSingleDialog(BuildContext context,String msg,{String btn = "我知道了"}){
    return showDialog(
        context: context,
        builder: (cont) {
          return Scaffold(
            body: Container(
              color: Colors.white,
              constraints: const BoxConstraints(minWidth: 150,maxHeight: 500),
              padding: const EdgeInsets.symmetric(horizontal: 15),
              child: SingleChildScrollView(
                child: Column(
                  mainAxisSize: MainAxisSize.min,
                  children: [
                    const SizedBox(height: 15),
                    Text(msg, softWrap: true,style: const TextStyle(fontSize: 13)),
                    const SizedBox(height: 10),
                    ElevatedButton(
                      child: Text(btn),
                      onPressed: () {
                        Navigator.pop(cont);
                      },
                    ),
                    const SizedBox(height: 10),
                  ],
                ),
              ),
            ),
          );
        });
  }
}